﻿using System;
using System.Diagnostics;

namespace MyTest
{
    /// <summary>
    /// Book2 的摘要说明
    /// </summary>
    public class Book2 : Product
    {
       public  string isbn; //书号
        public  string intro; //简介

        public string Isbn
        {
            get { return isbn; }
            set
            {
                if (value.Length != 13)
                {
                    throw new ArgumentException("请输入13位的ISBN号");
                }
                isbn = value;
            }


        }
        public string Intro
        {
            get { return intro; }
            set { intro = value; }

        }

        public Book2() : base("默认书籍名")
        {
            Debug.WriteLine("-=调用Books2无参数构造方法=-");
        }


        public override string ShowDetail()
        {
            //return base.Show();
            return "ISBN:" + this.isbn + ",简介：" + this.intro;
        }

        public override string Show()
        {
            
            return "书籍名称:" + this.name + ",书籍价格：" + this.price;
        }

        ~Book2()
        {
            Debug.WriteLine("-=调用Books2析构方法=-");
        }
    }
}
